
<div class="filter-bar">
	<form action="__CONTROLLER__/index" method="post" >
		<div class="view">
			<div class="row clearfix">
				<div class="col-md-6 column ui-sortable">
				    <label class="col-sm-5 control-label" style="width: 100px;margin-top: 8px;">请选择栏目</label>
				    <div class="col-sm-12" style="width:400px;">
					      <select class="form-control" style="width: 195px;float: left;margin-right: 10px;"  name="article_category_id">
			              {$articleCategoryOptions}
			              </select>
			              <input type="submit"  class="btn btn-primary" value="搜索">
				    </div>
				</div>							
			</div>
		</div>
	</form>
</div>
<hr/>
<form>
<table class="table table-hover">
  <thead>
    <tr>
      <th>ID</th>
       <th>所属栏目</th>
      <th>标题</th>
      <th>图片</th>
      <th>连接地址</th>
      <th>状态</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
    <foreach name="adContent" item="vo">
    <tr> 
      <td>{$vo.id}</td>
      <td>{$vo.categoryName}</td>
      <td>{$vo.title}</td>
      <td><img src="{$vo.pic}" alt=""  width="100"/></td>
      <td>{$vo.url}</td>
      <td class="status">
       {$vo["status"]?"启用":"停用"}
      </td>
      <td>
      <a class="btn btn-primary btn-xs" href="__CONTROLLER__/modify/id/{$vo.id}">修改</a>
       <a class="btn btn-info btn-xs action-status" data-action-id="{$vo.id}" data-action-txt="执行中……" data-action-status="{$vo.status}" data-action-status-txt="启用 停用" data-action-url="__CONTROLLER__/setStatus">{$vo["status"]?"停用":"启用"}</a>
        <a class="btn btn-danger btn-xs actionds" data-action-id="{$vo.id}" data-action-txt="移除中……" data-action-url="__CONTROLLER__/remove">移除</a>
      </td>
    </tr>
    </foreach>
  </tbody>
</table>
<div class="pagination">{$pagination}</div>

<script type="text/javascript">
  $(function(){	  
    $( ".table" ).delegate( ".audit", "change", function(){
      var status = $( this ).val(),
          id = $( this ).attr( "data-id" );
      $.post ( "__CONTROLLER__/setStatus", { "id": id, "status": status}, function(data){
        if( data.error ) {
          $().alertMsg( { "type": "error", "msg": data.msg } );
        } else {
          $().alertMsg( { "type": "success", "msg": data.msg } );
        };
      });
    });
  });
</script>